package com.topvision.controller.hes;

import com.topvision.model.hes.HesExpert;
import com.topvision.service.hes.HesExpertService;
import com.topvision.service.region.RegionService;
import com.topvision.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 专家用户
 *
 * @author shengwm
 * @email 179653076@qq.com
 * @date 2017-08-30 14:27:46
 */
@RestController
@Api(value = "专家信息接口", description = "根据地址、设备类型等查看专家信息")
@RequestMapping("hes/hesexpert")
public class HesExpertApiController {
    @Autowired
    private HesExpertService hesExpertService;
    @Autowired
    private RegionService regionService;




    /**
     * 信息
     */
    @RequestMapping(value = "/hesExperts", method = RequestMethod.POST)
    @ApiOperation(value = "根据地址、设备类型等找专家", produces = MediaType.APPLICATION_JSON_VALUE,notes = "专家列表",response = R.class)
    public R getExpertsByCityCode( @RequestParam String citycode,@RequestParam String adept){
        Map<String,Object> map = new HashMap<>();
        map.put("citycode",citycode);
        map.put("adept",adept);
        List<HesExpert> hesExperts = hesExpertService.queryByParam(map);
        return R.success().put("hesExpert", hesExperts);
    }


}
